package wxshop.service.user.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wxshop.api.admin.model.wx.WxUserInfo;
import wxshop.api.user.dao.UserDao;
import wxshop.api.user.model.User;
import wxshop.api.user.model.WxUnionID;
import wxshop.api.user.service.UserService;

import java.util.List;
import java.util.Set;

/**
 * Created by yvdedu.com on 2018/1/23.
 */
@SuppressWarnings("SpringJavaAutowiringInspection")
@Service
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserDao userDao;
	
	@Override
	public void insert (User input) {
		userDao.insert(input);
	}
	
	@Override
	public void delete (int id) {
	
	}
	
	@Override
	public void update (User input) {
	
	}
	
	@Override
	public List<User> query () {
		return null;
	}
	
	@Override
	public User get (int id) {
		return userDao.get(id);
	}
	
	@Override
	public Set<String> getUserUrls (int id) {
		return userDao.getUserUrl();
	}
	
	@Override
	public List<User> getInfo (int id) {
		return  userDao.getInfo(id);
	}
	
	//插入openid用户信息
	@Override
	public int insertUserInfo (WxUserInfo input) {
		return userDao.insertWxUnionID(input);
	}
	//删除openid用户信息
	@Override
	public int deleteUserInfo (String input) {
		return userDao.deleteWxUnionID(input);
	}
	
	@Override
	public WxUnionID getNickName (int id) {
		return userDao.getWxNickName(id);
	}
}
